<?php
/**
 * Created by PhpStorm.
 * User: 17274
 * Date: 2018/3/28
 * Time: 14:21
 */

namespace app\admin\controller;

use think\Config;
use think\Request;

class Server extends Base
{
    /*
     * 依赖注入Model
     * */
    public function __construct(){
        parent::__construct();
    }

    /*
     * 实时监控
     * */
    public function server_index(){
        if(Request::instance()->isPost()){
            //CURL获取实时服务器信息
            $data=curl_api(Config::get('server_url'),'');
            return $data;
        }
        return $this->fetch('server/index');
    }

    /*
     * 消息队列
     * */
    public function server_queue(){
        return $this->fetch('server/queue');
    }

}